<!-- 开始人节点组件 -->
<template>
  <div class="delay" :class="!showNextArrowAdd&&'hiddenNextArrowAdd'">
    <nodeCard :data="data" :node-list="nodeList"></nodeCard>

    <nextArrowAdd :before-node="data"></nextArrowAdd>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, toRefs, onMounted,computed} from 'vue'
import type { PropType } from 'vue';
import nextArrowAdd from '../component/next-arrow-add.vue';
import BaseFlowNode from '../../class/BaseFlowNode';
import rightArrowPng from '../../assets/imgs/right-arrow.png';
import { FlowNodeType } from '../../types';
import nodeCard from '../component/node-card.vue';

let props = defineProps({
  data: {
    type: Object as PropType<BaseFlowNode>,
    default: () => {
      return {}
    }
  },
    //当前支路径下的所有节点
    nodeList: {
    type: Array as PropType<Array<BaseFlowNode>>,
    default: () => {
      return []
    }
  }
})

//是否展示指向下一级的箭头
let showNextArrowAdd=computed(()=>{
  if(props.data.getNodeId()==props.nodeList.at(-1)?.getNodeId()&&props.data.getNodeType()!=FlowNodeType.END){
    return false
  }else{
    return true
  }
})
</script>
<style scoped lang="less">
@import url('../../styles/index.less');

.delay{
  width:@node-width;
  height: fit-content;
  position: relative;
//  z-index: @node-zIndex;
  // border: 1px solid #d9d9d9;
}


.hiddenNextArrowAdd /deep/  .next-arrow-add::after{
  border-width: 0px;
}
</style>